#ifndef _VLAN_INTERFACE_H_
#define _VLAN_INTERFACE_H_
#include "list.h"

typedef struct {
    int     vid;
    char   *name;
    struct list_head vlan_list;
} vlan_t;

typedef struct {
    int     pid;
    int     speed;
    int     duplex;
    struct list_head port_list;
} port_t;

typedef struct {
    int     vid;
    int     pid;
    struct list_head relation_list;
} relation_t;

vlan_t *vid_to_vlan(int vid);
port_t *phy_pid_to_port(int pid);
int phy_add_port_to_vlan(int vid, int pid);
void phy_del_port_from_vlan(int vid, int pid);
int phy_is_contain(int vid, int pid);
int phy_create_vlan(int vid, char *name);
void phy_destory_vlan(int vid);
void phy_print_info(int vid, int pid);
void phy_for_each_port(int vid, void (*operation)(int pid, int vid));
void phy_for_each_vlan(int pid, void (*operation)(int pid, int vid));
int phy_add_port(int pid, int speed, int duplex);
void phy_delete_port(int pid);
void phy_clean_all();

#endif /* _VLAN_INTERFACE_ */
